<?php
$profileURL = Common::getBaseUrl().'user/profile/';
$deleteFriendURL = Common::getBaseUrl().'user/deletefriend/';
?>
<section>
	<h2>List of Friends</h2>
	<?php echo Common::renderFlashMessage() ?>
	<p><?php if($this->notifyMessage) { echo $this->notifyMessage; } ?></p>
	<p><?php if($this->errorMessage) { echo $this->errorMessage; } ?></p>
	<?php 
		if ($this->allFriends):
		foreach($this->allFriends as $friend): 
	?>
		<article class="friends">
			<p>
			<div class="friendsUsername"><a href="<?php echo $profileURL.$friend['username']; ?>"><?php echo $friend['username']; ?></a></div>
			<div class="friendsDelete"><a href="<?php echo $deleteFriendURL.$friend['username']; ?>">Delete</a></div>
			</p>
		</article>
	<?php	
		endforeach;
		endif;
	?>
</section>